package com.allchips.pin.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 文件类型
 */
public enum DeleteFlagEnum {
    NO(10, "no", "未删除"),
    YES(20, "yes", "已删除"),
    ;
    //状态码
    private int statusCode;
    //状态英文
    private String statusMsgEn;
    //状态中文
    private String statusMsgCn;

    private static final Map<Integer, DeleteFlagEnum> lookup = new HashMap<>();

    static {
        for (DeleteFlagEnum ase : DeleteFlagEnum.values()) {
            lookup.put(ase.getStatusCode(), ase);
        }
    }

    DeleteFlagEnum(int statusCode, String statusMsgEn, String statusMsgCn) {
        this.statusCode = statusCode;
        this.statusMsgEn = statusMsgEn;
        this.statusMsgCn = statusMsgCn;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public String getStatusMsgEn() {
        return statusMsgEn;
    }

    public String getStatusMsgCn() {
        return statusMsgCn;
    }

    public static DeleteFlagEnum get(Integer statusCode) {
        return lookup.get(statusCode);
    }

    public static List<Integer> listCode() {
        return new ArrayList<>(lookup.keySet());
    }
}
